<template>
  <div class="containers">
    <div class="container">
      <div class="form-box" style="width: 100%; max-width: 1200px">
        <el-descriptions class="margin-top" title="奖励设置" :column="3"  border>
          <template slot="extra">
            <el-button type="primary" size="mini" @click="setlv()">保存</el-button>
          </template>
          <el-descriptions-item>
            <template slot="label">
              底池资金
            </template>
            <el-input   v-model="form.money" type="number"></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              底池茶果
            </template>
            <el-input   v-model="form.tea" type="number"></el-input>
          </el-descriptions-item>

          <el-descriptions-item>
            <template slot="label">
              分红池茶果
            </template>
            <el-input   v-model="form.dividend_tea" type/>

          </el-descriptions-item>

          <el-descriptions-item>
            <template slot="label">
              当前价格
            </template>
            <el-input readonly  v-model="form.price" type="number"></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              当天底池
            </template>
            <el-input readonly  v-model="form.pot" type="number"></el-input>
          </el-descriptions-item>

          <el-descriptions-item>
            <template slot="label">
              当天市值
            </template>
            <el-input readonly  v-model="form.market" type="number"></el-input>
          </el-descriptions-item>

          <el-descriptions-item>
            <template slot="label">
              当天平台利润
            </template>
            <el-input  readonly v-model="form.platform" type="number"></el-input>
          </el-descriptions-item>
          <el-descriptions-item>
          </el-descriptions-item>      <el-descriptions-item>
          </el-descriptions-item>








        </el-descriptions>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      code: 0,
      form: {
        money:0,//底池资金
        tea:0,//底池茶果
        dividend_tea:0,//分红池茶果
        price:0,//当前价格
        pot:0,//当天底池
        market:0,//当天市值
        platform:0,//当天平台利润

      },
    };
  },
  created() {
    this.load(); //获取
  },
  methods: {
    changeCode(e) {
      this.load(); //获取
    },
    load() {
      this.request("admin/releaseGetList/", "get", {}, "demo").then(
        (res) => {
          if (res.errno == 0) {
            this.form = res.data;
            console.log(this.form)
          }
        },
        function () {
          console.log("请求失败处理");
        }
      );
    },
    setlv() {

      this.$confirm("是否确认保存?", "提示", {
        type: "warning",
      }).then(() => {

        for (const field in this.form) {
          this.form[field] = Number(this.form[field]);

        }

        this.request("admin/releaseGetList/", "post", this.form, ).then(
          (res) => {
            this.$message.success(res.errmsg);
          },
          function () {
            console.log("请求失败处理");
          }
        );
      });
    },
  },
};
</script>
<style scoped="scoped">
.container {
  padding: 20px;
}

.activeattr {
  border: 1px solid rgb(64, 158, 255);
  color: rgb(64, 158, 255);
}

.el-upload {
  width: 100px !important;
  height: 100px !important;
}
</style>
